<?php
class Controller_Admin_Report extends Controller_Template
{
    public function __construct ($req, $res)
    {
        parent::__construct($req, $res);
        $this->template = 'smarty:report/downloads/default';
    }

    public function action_downloads($from='ijinshan') 
    {
        $dir = DOCROOT . '/utils/packages/csv';
        $files = scandir($dir);
        $xls   = array();
        foreach ($files as $fname)
        {
            if (substr($fname, -4) == '.xls')
            {
                $xls[] = $fname;
            }
        }
        $this->template->set('xls', $xls);
        $this->template->set('time', time());
        $this->template->set_filename('smarty:report/downloads/ijinshan');
    }
}
